<?

//声明启用session
session_start();

//鉴权
include_once '../controller/script/check_session.php';


//载入根目录config设定
include_once($_SERVER['DOCUMENT_ROOT']."/config.php");



$setting=select_one_line_all_items($table_prefix."setting","nid=1");

//按结品牌树
$brand_list=select_lines_all_items($table_prefix."brand","nid desc","parent_id = 0","");

//$brand_list=transform_2darray_in_1darray_number_as_key($brand_list,"name");

//循环，查找数据库中，parent_nid = 当前的 nid的值
foreach($brand_list as $key=>$value){
    $brand_list[$key][$value['name']]=select_lines_all_items($table_prefix."brand","listorder desc,name asc,nid desc",
                                                             "parent_id = '{$value['nid']}'","");

    //循环，$brand_list[$key]['grade'] 的数据，查找数据库中，parent_nid = 当前的 nid的值，记录在class
    foreach($brand_list[$key][$value['name']] as $k=>$v){
        $brand_list[$key][$value['name']][$k][$v['name']]=select_lines_all_items($table_prefix."brand",
                                                                                 "listorder desc,name asc,nid desc","parent_id = '{$v['nid']}'","");
    }
}



$links = select_lines_all_items($table_prefix."link","listorder desc,nid desc","(status != '已删除' or status is null) and publish = 1 ","")

?>



